<table cellpadding="1" cellspacing="1" border="2">
  <?php foreach($this->rateviewarr as $arr):?>
    <tr>
      <td>Category</td>
      <td>Basis</td>
     <!-- <td>type</td>-->
       <?php foreach($arr["tdarr"]["ratekey"]  as $key3=>$val3):?>
        <td>
          <?php echo $val3 ;?>
        </td>
       <?php endforeach;?>
        <td>Additional Info</td>
    </tr>
    <tr>
        <td>VALID FOR : <?php echo $arr["fromdate"]?> to  <?php echo $arr["todate"]?></td>
    </tr>
    <tr>

                <td><?php echo end($arr["tdarr"]["rate_category"]);?> </td>

 
                <td><?php echo end($arr["tdarr"]["rate_basis"]);?> </td>


               

           <?php foreach($arr["tdarr"]["rateval"] as  $key6=>$val6):?>

                <td>
                    <table>
                        <tr>
                            <td>Full board</td>
                            <td>Half Board</td>
                        </tr>
                        <tr>
                            <td><?php  echo (strlen($val6['FB']))>0?$val6['FB']:"-";?></td>
                            <td><?php  echo (strlen($val6['HB']))>0?$val6['HB']:"-";?></td>
                        </tr>
                    </table>
                </td>
            <?php endforeach;?>
                <td><?php echo end($arr["tdarr"]["rate_additionalinfo"]);?> </td>
    </tr>
  <?php endforeach;?>
</table>